package java3_27;

import java.util.Scanner;


/**
 * 3:输入字符串，计算可转换成的最大浮点数字，从左侧开始，直到非数字结束，
 * 比如输入124abc,则最大是124，如果是122.44fff,则是122.44
 * abc4444不能转换
 */
public class Homework2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.next();
//        Pattern p = Pattern.compile("[\\d][\\d.]*\\.?[\\d]*");
//        Matcher m = p.matcher(str);
        while (true){
            if (str.length()==0) {
                System.out.println("不行");
                break;
            }
            try {
                double d = Double.parseDouble(str);
                System.out.println(d);
                break;
            }catch (Exception e){
                str = str.substring(0,str.length()-1);
            }

        }

    }
}
